﻿<Page
    x:Class="InternetCafeApp.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:InternetCafeApp"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Width="Auto">
        <Grid.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FF3DC9E7" Offset="1"/>
                <GradientStop Color="White"/>
            </LinearGradientBrush>
        </Grid.Background>
        <Grid.RowDefinitions>
            <RowDefinition Height="100" />
            <RowDefinition Height="*" />
            <RowDefinition Height="50" />
            <RowDefinition Height="50" />
        </Grid.RowDefinitions>
        <Grid Grid.Row="0" Background="#FF2482E0" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBlock x:Name="pageTitle" Text="Internet Cafe Application" Style="{StaticResource PageHeaderTextStyle}" Grid.Column="1" IsHitTestVisible="false" TextAlignment="Center"/>
        </Grid>
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="200"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Grid Grid.Column="0" Grid.Row="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="10" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Button x:Name="btnAddReservation" Grid.Column="1" Content="Add Reservation"   Height="150" Click="AddReservation_Click" Width="200" BorderThickness="4" FontSize="20" Foreground="#FF0314BF">
                    <Button.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFF9BA11" Offset="1"/>
                            <GradientStop Color="White"/>
                        </LinearGradientBrush>
                    </Button.Background>
                    <Button.BorderBrush>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="Black"/>
                            <GradientStop Color="White" Offset="1"/>
                        </LinearGradientBrush>
                    </Button.BorderBrush>
                </Button>
                <Button x:Name="btnAddPayment" Grid.Column="2" Content="Add Payment"  Height="150"  Width="200" Click="btnAddPayment_Click"  BorderThickness="4" FontSize="20" Foreground="#FF0314BF">
                    <Button.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFF9BA11" Offset="1"/>
                            <GradientStop Color="White"/>
                        </LinearGradientBrush>
                    </Button.Background>
                    <Button.BorderBrush>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="Black"/>
                            <GradientStop Color="White" Offset="1"/>
                        </LinearGradientBrush>
                    </Button.BorderBrush>
                </Button>
                <Button x:Name="btnReport" Grid.Column="3" Content="Report" Height="150"  Click="AddReport_Click" Width="200"  BorderThickness="4" FontSize="20" Foreground="#FF0314BF">
                    <Button.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFF9BA11" Offset="1"/>
                            <GradientStop Color="White"/>
                        </LinearGradientBrush>
                    </Button.Background>
                    <Button.BorderBrush>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="Black"/>
                            <GradientStop Color="White" Offset="1"/>
                        </LinearGradientBrush>
                    </Button.BorderBrush>
                </Button>
                <Button x:Name="btnMntRooms" Grid.Column="4"  Content="Maintain Rooms"  Height="150"  Click="MaintainRoom_Click" Width="200" RenderTransformOrigin="2.495,2.293"  BorderThickness="4" FontSize="20" Foreground="#FF0314BF">
                    <Button.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFF9BA11" Offset="1"/>
                            <GradientStop Color="White"/>
                        </LinearGradientBrush>
                    </Button.Background>
                    <Button.BorderBrush>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="Black"/>
                            <GradientStop Color="White" Offset="1"/>
                        </LinearGradientBrush>
                    </Button.BorderBrush>
                </Button>
                <Button x:Name="btnMntRecord" Grid.Column="5" Content="Maintain Records" Height="150"  Width="200" Click="MaintainRecord_Click"  BorderThickness="4" FontSize="20" Foreground="#FF0314BF">
                    <Button.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFF9BA11" Offset="1"/>
                            <GradientStop Color="White"/>
                        </LinearGradientBrush>
                    </Button.Background>
                    <Button.BorderBrush>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="Black"/>
                            <GradientStop Color="White" Offset="1"/>
                        </LinearGradientBrush>
                    </Button.BorderBrush>
                </Button>
            </Grid>
            <Grid Grid.Row="1" Grid.Column="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Grid  Grid.Column="0" Grid.Row="1">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="10" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="10" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="40" />
                        <RowDefinition Height="*" />
                        <RowDefinition Height="10" />
                    </Grid.RowDefinitions>
                    <TextBlock Text="Rooms Status" FontSize="30" Foreground="Black" Grid.Column="1" Grid.Row="0" />
                    <ListView x:Name="ItemListView" ItemsSource="{Binding RecordsInt}"  Background="#7FFFFFFF" Width="Auto" Height="Auto"  Grid.Column="1" Grid.Row="1"
                    HorizontalAlignment="Left"
                    ItemTemplate="{StaticResource HomeScreenTileTemplate}"
                    ItemContainerStyle="{StaticResource StoreFrontLVTileStyle}"
                    BorderBrush="LightGray"
                    BorderThickness="1" VerticalAlignment="Stretch" ScrollViewer.VerticalScrollBarVisibility="Auto"
                    ScrollViewer.HorizontalScrollBarVisibility="Auto" SelectionMode="Single" />
                </Grid>
                <Grid Grid.Column="1" Grid.Row="0" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="10" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="10" />
                        <ColumnDefinition Width="250" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*" />
                        <RowDefinition Height="*" />
                        <RowDefinition Height="*" />
                        <RowDefinition Height="*" />
                        <RowDefinition Height="*" />
                        <RowDefinition Height="*" />
                        <RowDefinition Height="*" />
                        <RowDefinition Height="*" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row="0" Grid.Column="1" TextWrapping="Wrap" Text="Summary Overview : " FontSize="36" Foreground="Black" TextAlignment="Justify"/>
                    <TextBlock Grid.Row="1" Grid.Column="1" TextWrapping="Wrap" Text="Total Number of Rooms :" Foreground="Black" FontSize="36" TextAlignment="Justify"/>
                    <TextBlock Grid.Row="1" Grid.Column="3"  TextWrapping="Wrap" Text="{Binding Rooms.Count}"  Foreground="Black" FontSize="36"/>
                    <TextBlock Grid.Row="2" Grid.Column="1" TextWrapping="Wrap" Text="Total Booked Room :" Foreground="Black" FontSize="36" TextAlignment="Justify"/>
                    <TextBlock Grid.Row="2" Grid.Column="3"  TextWrapping="Wrap" Text="{Binding RecordsInt.Count}"  Foreground="Black" FontSize="36"/>
                    <TextBlock Grid.Row="3" Grid.Column="1" TextWrapping="Wrap" Text="Total Free Rooms :" Foreground="Black" FontSize="36" TextAlignment="Justify"/>
                    <TextBlock Grid.Row="3" Grid.Column="3"  TextWrapping="Wrap" Text="{Binding RecordsInt.Count}"  Foreground="Black" FontSize="36"/>
                    <TextBlock Grid.Row="4" Grid.Column="1" TextWrapping="Wrap" Text="Total Webcam :" Foreground="Black" FontSize="36" TextAlignment="Justify"/>
                   <!-- <TextBlock Grid.Row="4" Grid.Column="3"  TextWrapping="Wrap" Text="{Binding RecordsInt.Count}"  Foreground="Black" FontSize="36"/>-->
                    <TextBlock Grid.Row="5" Grid.Column="1" TextWrapping="Wrap" Text="Total Free Webcam :" Foreground="Black" FontSize="36" TextAlignment="Justify"/>
<!--                    <TextBlock Grid.Row="5" Grid.Column="3"  TextWrapping="Wrap" Text="{Binding RecordsInt.Count}"  Foreground="Black" FontSize="36"/>-->
                    <TextBlock Grid.Row="6" Grid.Column="1" TextWrapping="Wrap" Text="Total Card Reader :" Foreground="Black" FontSize="36" TextAlignment="Justify"/>
<!--                    <TextBlock Grid.Row="6" Grid.Column="3"  TextWrapping="Wrap" Text="{Binding RecordsInt.Count}"  Foreground="Black" FontSize="36"/> -->
                    <TextBlock Grid.Row="7" Grid.Column="1" TextWrapping="Wrap" Text="Total Free Card Reader :" Foreground="Black" FontSize="36" TextAlignment="Justify"/>
<!--                   <TextBlock Grid.Row="7" Grid.Column="3"  TextWrapping="Wrap" Text="{Binding RecordsInt.Count}"  Foreground="Black" FontSize="36"/>  -->


                    <ComboBox x:Name="PeriodMs" SelectedIndex="0" Grid.Row="4" Grid.Column="3">
                        <ComboBoxItem>100</ComboBoxItem>
                        <ComboBoxItem>500</ComboBoxItem>
                        <ComboBoxItem>1000</ComboBoxItem>
                        <ComboBoxItem>5000</ComboBoxItem>
                        <ComboBoxItem>10000</ComboBoxItem>
                    </ComboBox>
                    <Button x:Name="CreatePeriodicTimerButton" Content="Create" Grid.Row="5" Grid.Column="3" Margin="0,0,10,0" Click="CreatePeriodicTimer" IsEnabled="True" />
                    <Button x:Name="CancelPeriodicTimerButton" Content="Cancel" Grid.Row="6" Grid.Column="3" Margin="0,0,10,0" Click="CancelPeriodicTimer" IsEnabled="False" />
                        
                    <TextBlock Style="{StaticResource HeaderTextStyle}" TextWrapping="Wrap" Text="Thread pool periodic timer"  />
                    <TextBlock x:Name="PeriodicTimerInfo" Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" Text=""  Grid.Column="3" Grid.Row="7"/>
                    <TextBlock x:Name="PeriodicTimerStatus" Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" Text=""  Grid.Column="3" Grid.Row="3"/>

                </Grid>

            </Grid>
        </Grid>
        <Grid Grid.Row="2" Grid.Column="0" >
            <Grid.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Black"/>
                    <GradientStop Color="Black" Offset="0.996"/>
                    <GradientStop Color="#7FFFFFFF" Offset="0.5"/>
                </LinearGradientBrush>
            </Grid.Background>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Canvas   Name="canMain" Grid.Column="1" >
                <Canvas.Triggers>
                    <EventTrigger RoutedEvent="Canvas.Loaded" >
                        <BeginStoryboard>
                            <Storyboard x:Name="animation" Storyboard.TargetProperty="(Canvas.Left)" RepeatBehavior="Forever" >
                                <!-- default 820-->
                                <DoubleAnimation Storyboard.TargetName="ScrollingText" From="0" To="-2800" Duration="0:0:10"  />
                                <DoubleAnimation Storyboard.TargetName="ScrollingText2" From="2800" To="-820" Duration="0:0:10"  />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                </Canvas.Triggers>


                <TextBlock x:Name="ScrollingText"  FontFamily="Gautami" FontSize="40" Foreground="Green"  Text="" />
                <TextBlock x:Name="ScrollingText2"  FontFamily="Gautami" FontSize="40" Foreground="Green" Text="You have only two room free." />
            </Canvas>

        </Grid>
        <Grid Grid.Row="3" Background="#FFB00505" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBlock Text="© 2013 TriadsLabs. All Right Reserved." FontFamily="Gautami" FontSize="40" Grid.Column="1" IsHitTestVisible="false" TextAlignment="Center"/>
        </Grid>

    </Grid>
    <Page.BottomAppBar>
        <AppBar x:Name="bottomAppBar" Padding="10,0,10,0">
            <Grid>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                    <Button Style="{StaticResource AddAppBarButtonStyle}" Name="btnAdd" Click="btnAdd_Click"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                    <Button Style="{StaticResource SettingsAppBarButtonStyle}" Name="btnSettings" Click="btnSettings_Click"/>
                    <Button Style="{StaticResource HelpAppBarButtonStyle}" Name="btnHelp" Click="btnHelp_Click"/>
                </StackPanel>
            </Grid>
        </AppBar>
    </Page.BottomAppBar>
</Page>
